x86/P2M: allow 2M superpage use for shadowed guests
authorJan Beulich <jbeulich@suse.com>
Thu, 18 Aug 2022 07:29:34 +0000 (09:29 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 18 Aug 2022 07:29:34 +0000 (09:29 +0200)
commitf2d947ac0738098ec2f52a17448df7e2acd64ff9
tree55f2e670e55f23141227ebc010c8ade66a4a3f89
parent6270081c57978ff32d76d8eb11196fd217f7af2d
x86/P2M: allow 2M superpage use for shadowed guests

For guests in shadow mode the P2M table gets used only by software. The
only place where it matters whether superpages in the P2M can be dealt
with is sh_unshadow_for_p2m_change(): The table is never made accessible
to hardware for address translation, and the only checks of _PAGE_PSE in
P2M entries in shadow code are in this function (all others are against
guest page table entries). That function has been capable of handling
them even before commit 0ca1669871f8a ("P2M: check whether hap mode is
enabled before using 2mb pages") disabled 2M use in this case for
dubious reasons ("potential errors when hap is disabled").

While doing this, move "order" into more narrow scope and replace the
local variable "d" by a new "hap" one.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/p2m.c